CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

project(Galaxians)

SET (CMAKE_USE_RELATIVE_PATHS TRUE)

#MESSAGE (STATUS "Toolchain: ${CMAKE_TOOLCHAIN_FILE}")

MESSAGE (STATUS "Include:  ${PROJECT_BINARY_DIR}")

MESSAGE (STATUS "SDK: ${CMAKE_WINCE_SDK}")

MESSAGE (STATUS "System: ${CMAKE_SYSTEM_NAME}")
MESSAGE (STATUS "Version: ${CMAKE_SYSTEM_VERSION}")

message(STATUS "Cross compiling: ${CMAKE_CROSSCOMPILING}")

add_definitions(
	-DWINCE
	-DWIN32_PLATFORM_PSPC
	-D_WINDOWS
	-D_UNICODE
	-DUNICODE
	-DPOCKETPC2003_UI_MODEL
	-D_MBCS
)

# Windows CE Version
add_definitions(
	-D_WIN32_WCE=0x501
	-DPOCKETPC2003_UI_MODEL 
	-DWIN32_PLATFORM_PSPC=0x501
	-DUNDER_CE=0x501
)

# Architecture
add_definitions(
	-DARM
	-D_ARM_
)

#SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bleh")
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "bin")
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "bin")

#set(CMAKE_SHARED_LINKER_FLAGS "/subsystem:windowsce,4.20 /machine:THUMB")
SET (CMAKE_EXE_LINKER_FLAGS "/subsystem:windowsce,5.01")

set(CMAKE_CXX_STANDARD_LIBRARIES "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib ws2.lib")

add_executable (
  Galaxians
  ${PROJECT_SOURCE_DIR}/src/Game.h 
  ${PROJECT_SOURCE_DIR}/src/Game.cpp 
  ${PROJECT_SOURCE_DIR}/src/Player.h 
  ${PROJECT_SOURCE_DIR}/src/Bullet.h 
  ${PROJECT_SOURCE_DIR}/src/Alien.h
)

SET (CMAKE_CFG_OUTDIR "${PROJECT_SOURCE_DIR}")
message (STATUS "Dir: ${CMAKE_CFG_OUTDIR}")
link_directories ("${CMAKE_CFG_OUTDIR}/../../YoghurtGum/bin")
message (STATUS "Dir: ${CMAKE_CFG_OUTDIR}/../../YoghurtGum/bin")

target_link_libraries(Galaxians YoghurtGum.lib)